CMAKE_MINIMUM_REQUIRED(VERSION 3.17)
PROJECT(Gt)

INCLUDE(CMakeModules/CPM.cmake)

CPMAddPackage(
        NAME LIB_GIT_2
        GITHUB_REPOSITORY libgit2/libgit2
        VERSION 1.1.0
)

FIND_PACKAGE(Qt5Widgets REQUIRED)
SET(CMAKE_AUTOMOC ON)
SET(CMAKE_AUTOUIC ON)
SET(CMAKE_AUTORCC ON)
ADD_EXECUTABLE(Gt
        main.cpp
        MainWindow.cpp
        FileSystemTree.cpp
        PanelFiles.cpp
        PanelMessage.cpp
        PanelMessageOption.cpp
        Repository.cpp
        Status.cpp Status.hpp)
TARGET_INCLUDE_DIRECTORIES(Gt PRIVATE ${LIB_GIT_2_SOURCE_DIR}/include/)
TARGET_LINK_LIBRARIES(Gt PRIVATE git2)
TARGET_LINK_LIBRARIES(Gt PRIVATE Qt5::Widgets)
SET_TARGET_PROPERTIES(Gt PROPERTIES CXX_STANDARD 17)

FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Font DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Test DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)